<%@ page pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<div class="header">
	<h2>
		评价<span><font color="red">（* 为必填项）</font> </span>
	</h2>
</div>
<form:form commandName="model" cssClass="validate"
	id="performanceItemDetailForm"
	action="performance/performanceItemDetail/save">
	<form:hidden path="id" />
	<table class=" form-table">
		<tbody>

			<tr>
				<td class="td1">指标名称：</td>
				<td class="td2">${model.name }</td>
			</tr>

			<tr>
				<td class="td1">目标说明：</td>
				<td class="td2"><label><pre>${model.target }</pre>
				</label></td>
			</tr>
			<tr>
				<td class="td1">衡量标准：</td>
				<td class="td2"><label><pre>${model.referencPoint }</pre>
				</label></td>
			</tr>
			<tr>
				<td class="td1">权重：</td>
				<td class="td2">${model.weight }%</td>
			</tr>
			<c:if test="${model.computeType eq '系统'}">
				<tr>
					<td class="td1">系统评分：</td>
					<td class="td2"><form:hidden path="sysScore"
							cssStyle="width:75px" value='${cpSysScore }' /> ${cpSysScore }</td>
				</tr>
			</c:if>
			<c:choose>
				<c:when test="${type eq '0'}">
					<tr>
						<td class="td1">自评分：</td>
						<td class="td2"><form:input path="selfScore"
								class="number required" />
						</td>
					</tr>

					<tr>
						<td class="td1">完成情况：</td>
						<td class="td2"><form:textarea path="situation" /></td>
					</tr>
				</c:when>
				<c:otherwise>
					<tr>
						<td class="td1">提交人自评分：</td>
						<td class="td2"><span style='color:red;'>${model.selfScore }</span></td>
					</tr>
					<c:if test="${not empty model.situation }">
						<tr>
							<td class="td1">提交人评价：</td>
							<td class="td2"><pre>${model.situation }</pre></td>
						</tr>
					</c:if>

					<tr>
						<td class="td1">评分：</td>
						<td class="td2">
						  <form:input path="managerScore"
								class="number required" />
						</td>
					</tr>

					<tr>
						<td class="td1">评价：</td>
						<td class="td2">
						 <form:textarea path="managerEvaluate" />
						</td>
					</tr>

				</c:otherwise>
			</c:choose>

		</tbody>
	</table>
</form:form>

<isperp:buttonList>
	<button class="submit nui-mainbtn" onclick="return takeSubmit()">保存</button>
</isperp:buttonList>
<script type="text/javascript">
	function takeSubmit() {
		if(check())
		{
		  isperp.submitForm();
		}else
		{
		  return false;
		}
	}

	function check() {
        var checkScore=0;
        var type='${type}';
		var t = parseFloat('${model.weight }');
		if(type=='0')
		{ 
		   checkScore = parseFloat($("#selfScore").val());
		}else if(type=='1')
		{
		   checkScore = parseFloat($("#managerScore").val());
		}
		t=150;
		if (checkScore > t) {
			isperp.alert("评分不能超过" + t + "分");
			return false;
		} else {
			return true;
		}
	}
</script>


